﻿/*
 * 由SharpDevelop创建。
 * 用户： Administrator
 * 日期: 2024/5/27
 * 时间: 16:12
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;
using System.Drawing;
using System.Globalization;
using System.Collections;
using System.Windows.Forms;
using System.Runtime.InteropServices;
	
namespace form
{
	/// <summary>
	/// Description of Form2.
	/// </summary>
	public partial class Form1 : Form
	{
		[DllImport("user32.dll")]
        public static extern bool ReleaseCapture();

        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

        private const int VM_NCLBUTTONDOWN = 0XA1;//定义鼠标左键按下
        private const int HTCAPTION = 2;
        
		public Form1()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
//			ChinaDate.GetChinaDate(DateTime dt) //获取农历日期
//
//			ChinaDate.GetYear(DateTime dt) //获取农历年份（包含天干地支和生肖信息）
//			
//			ChinaDate.GetMonth(DateTime dt) //获取农历月份
//			
//			ChinaDate.GetDay(DateTime dt) //获取农历日期
//			
//			ChinaDate.GetSolarTerm(DateTime dt) //获取节气
//			
//			ChinaDate.GetHoliday(DateTime dt) //获取公历节日
 
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		void Timer1Tick(object sender, EventArgs e)
		{
			this.label1.Text=DateTime.Now.AddSeconds(0).ToString("yyyy年MM月dd日 dddd tt hh:mm:ss");
		}
		void Label1MouseDown(object sender, MouseEventArgs e)
		{
			//为当前应用程序释放鼠标捕获
            ReleaseCapture();
            //发送消息 让系统误以为在标题栏上按下鼠标
            SendMessage((IntPtr)this.Handle, VM_NCLBUTTONDOWN, HTCAPTION, 0);
		}
		
		 
	}
}
